/*
 * File: MualGUI.h
 * ===============
 * Header file of Mual Graphics User Interface(MGUI) and Mual Desktop 
 * Environment(MDE).
 * License: GPL
 * Author: Charles Weng
 */
#pragma once

#define TitleHeight 2

struct Element{
	std::string str;
	int x;
	int y;
	struct Element *next;
};
typedef struct win
{
    std::string Title;
    int Top;
    int Bottom;
    int Left;
    int Right;
	int vTop;
	int vBottom;
	int vLeft;
	int vRight;
	bool isVarLocked;
	struct Element *var;
}*Window;
typedef struct Display{
    unsigned FID;
    Window Frame;
    bool isHide;
    struct Display *next;
}*XDesktop;
static bool isConfigured;

int DrawTitle(Window);    //Draw the title of a window.
Window NewWindow(int,int,int,int,std::string);  //Create a new window.
int RegisterWindow(Window);  //Register window in MDE.
int ClearBoard();  //Clear all.
int DrawWindow(Window);  //Draw window's body
int StartX();   // Load X Service.
void gotoxy(int x, int y);  // Go to a point on the screen.
int XDaemon();   // use while sentence to call it. It's a X command shell.
int Refresh();   // Refresh and update MDE.
int SearchFID(std::string);   // Search Frame ID.
int SwitchTo(int FID);  // Switch to a window.
int list();   // list all windows.
int kill(int FID);  //kill a window
int EndX(); // Exit X.
int killall();  //kill all windows
int ReloadX();  //reload X.
int MoveTo(int Top, int Left, int Right, int Bottom, int FID);
Window GetFrameInfo(int FID);
int MaxiumWin(int FID);
int MiniumWin(int FID);
int RecoverWin(int FID);
int myflush();
int MoveRight(int FID);
int MoveUp(int FID);
int MoveDown(int FID);
int MoveLeft(int FID);
XDesktop FrameToDesktop(int FID);
int MyDrawText(int FID, int vTop, int vLeft, std::string _str);
int ShowFrameInfo(Window myhwnd, int FID);
std::string convert(int n);